<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <title><!--{$lang.page.index.title}--></title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/lay/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/lay/layui/index.css" media="all">
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-body" style="padding: 15px;">
        <form name="addItem" method="post" lay-filter="component-form-group" class="layui-form">
          <input type="hidden" value="<!--{$datainfo.id}-->" name="id">
          <input type="hidden" value="<!--{$datainfo.aid}-->" name="aid">
          <input type="hidden" value="1" name="status">
          <input type="hidden" name="codes" value="<!--{$datainfo.codes}-->" >
          <input type="hidden" name="integra" value="<!--{$datainfo.integra}-->" >
          <input type="hidden" name="amounts" value="<!--{$user.amount}-->" >
          <input type="hidden" name="type" value="<!--{$datainfo.type}-->" >
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label"> <!--{$lang.page.table.account}--><!--{$lang.page.table.money}--></label>
              <div class="layui-input-inline">
               <input type="text" id="amount" name="amount" value="<!--{$user.amount}-->" class="layui-input" readonly/>
              </div>
            </div>
            <div class="layui-inline" id="showintegra">
              <label class="layui-form-label"><!--{$lang.page.table.give}--><!--{$lang.page.table.money}--></label>
              <div class="layui-input-inline">
                <input type="text" id="integra" name="integras" value="<!--{$user.integra}-->" class="layui-input" readonly/>
              </div>
            </div>
            
          </div>
          <div class="layui-form-item">
            
            <div class="layui-inline">
              <label class="layui-form-label"><!--{$lang.page.table.cashout}--><!--{$lang.page.table.curtype}--></label>
              <div class="layui-input-block">
               <input type="text"  class="layui-input layui-btn-disabled" value="<!--{$datainfo.codes}-->" name="codes" readonly> 
              </div>
            </div>

            <div class="layui-inline">
              <label class="layui-form-label"> <!--{$lang.page.table.cashout}--><!--{$lang.page.table.money}--></label>
              <div class="layui-input-inline">
               <input type="text" name="money" id="money" value="<!--{$datainfo.money}-->" lay-verify="money" class="layui-input layui-btn-disabled" readonly/>
              </div>
            </div>

            <div class="layui-inline" id="showintegra">
              <label class="layui-form-label"><!--{$lang.page.table.fee}--></label>
              <div class="layui-input-inline">
                <input type="text" name="fee" id="fee" value="<!--{$datainfo.fee}-->" class="layui-input layui-btn-disabled" readonly/>
              </div>
            </div>
            
            

            <div class="layui-inline">
              <label class="layui-form-label"><!--{$lang.page.table.type}--></label>
              <div class="layui-inline">
                <!--{if $datainfo.type eq 1}-->
                <button type="button" class="layui-btn layui-btn-sm layui-btn-danger"><!--{$lang.page.table.withdrawal}--></button>
                <!--{else if $datainfo.type eq 2}-->
                <button type="button" class="layui-btn layui-btn-sm layui-btn-danger"><!--{$lang.page.table.payment}--></button>
                <!--{else if $datainfo.type eq 3}-->
                <button type="button" class="layui-btn layui-btn-sm layui-btn-danger"><!--{$lang.page.table.cutpay}--></button>
                <!--{/if}-->
              </div>
            </div>
          </div>
 
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label"><!--{$lang.page.table.exchange}--><!--{$lang.page.table.curtype}--></label>
              <div class="layui-input-block">
                <input type="text"  class="layui-input layui-btn-disabled" value="<!--{$datainfo.currency}-->" name="codes" readonly>
              </div>
            </div>
            
            
            <div class="layui-inline">
              <label class="layui-form-label"><!--{$lang.page.table.exchange}--><!--{$lang.page.table.money}--></label>
              <div class="layui-input-inline">
                <input type="text" name="remoney" id="remoney" value="<!--{$datainfo.remoney-$datainfo.fee*$datainfo.rate}-->" lay-verify="remoney" class="layui-input layui-btn-disabled" readonly/>
              </div>
            </div>

            <div class="layui-inline" id="payment" <!--{if $datainfo.type eq 3}--> style="display: none;"<!--{/if}-->>
              <label class="layui-form-label"><!--{$lang.page.table.account}--></label>
              <div class="layui-inline">
                <select name="payment" id="selector" lay-verify="payment">
                    <option value=""><!--{$lang.page.table.receive}--><!--{$lang.page.table.account}--></option>
                    <!--{foreach from=$bank item=item key=key}--> 
                     <option value="<!--{$item.bank_account}-->" <!--{if $item.bank_account eq $datainfo.payment}-->selected<!--{/if}-->><!--{$item.bank_name}-->-<!--{$item.bank_account}-->-<!--{$item.deposit_name}--></option>
                    <!--{/foreach}-->
                </select>
              </div>
            </div>

            <div class="layui-inline">
              <label class="layui-form-label"><!--{$lang.page.table.exchange}--><!--{$lang.page.table.rate}--></label>
              <div class="layui-input-inline">
                <input type="text" name="rate" class="layui-input layui-btn-disabled" value="<!--{$datainfo.rate}-->" readonly>
              </div>
            </div>
            
          </div>

          <div class="layui-form-item">
              <label class="layui-form-label"><!--{$lang.page.table.receipt}--></label>
              <div class="layui-inline">
               <div class="layui-upload">
                <!--{if !empty($datainfo.file_url)}-->
                  <button type="button" class="layui-btn" onclick="xadmin.showimg({url:'<!--{$datainfo.file_url}-->',par:true});"><!--{$lang.page.table.view}--></button>
                <!--{else}-->
                  <button type="button" class="layui-btn layui-btn-disabled" disabled><!--{$lang.page.table.noreceipt}--></button>
                <!--{/if}-->
                </div>
              </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label"><!--{$lang.page.table.notes}--></label>
            <div class="layui-inline">
               <textarea name="notes" placeholder="<!--{$lang.page.public.pinput}-->" class="layui-textarea" ><!--{$datainfo.notes}--></textarea>
            </div>
          </div>

          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label"><!--{$lang.page.table.status}--></label>
              <div class="layui-input-block">
                <!--{if $datainfo.status ==1 }--> 
                <input type="radio" name="status" value="1" title="<!--{$lang.page.table.applying}-->" <!--{if $datainfo.status eq 1}--> checked<!--{/if}-->>&nbsp;&nbsp;
                <input type="radio" name="status" value="2" title="<!--{$lang.page.table.gback}-->" <!--{if $datainfo.status eq 2}--> checked<!--{/if}-->>&nbsp;&nbsp;
                <input type="radio" name="status" value="3" title="<!--{$lang.page.table.pass}-->" <!--{if $datainfo.status eq 3}--> checked<!--{/if}-->>
                <!--{else if $datainfo.status ==2 }--> 
                <input type="radio" name="status" value="2" title="<!--{$lang.page.table.gback}-->" <!--{if $datainfo.status eq 2}--> checked<!--{/if}-->>
                <!--{else if $datainfo.status ==3 }-->
                <input type="radio" name="status" value="3" title="<!--{$lang.page.table.pass}-->" <!--{if $datainfo.status eq 3}--> checked<!--{/if}-->> 
                <!--{/if}-->
              </div>
            </div>
          </div>

          <div class="layui-form-item layui-layout-admin">
            <div>
              <div class="layui-footer" style="left: 0;">
                <!--{if $datainfo.status ==1 }--> 
                <button class="layui-btn" type="button" id="submit" lay-submit lay-filter="submit"><!--{$lang.page.public.submit}--></button>
                <!--{/if}-->
                <button type="button" class="layui-btn layui-btn-primary" onClick="xadmin.close();" ><!--{$lang.page.table.back}--></button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
<script src="/static/lay/layui/layui.js"></script>
  <script type="text/javascript">
    layui.config({
     base: '/static/lay/' //静态资源所在路径
   }).extend({
     xadmin: 'lib/xadmin' //弹窗
   }).use(['jquery', 'layer','xadmin', 'form','upload'], function(){
    var form = layui.form;
    var upload = layui.upload;
    form.render(null, 'component-form-group');
    moneyinput=/\d+/;
    /* 自定义验证规则 */
    form.verify({
      money: function(value){
        if(value <= 0){
          return '金额大于0';
        }
        if(!moneyinput.test(value)){
          return '只能為數字';
        }
      }
    });

    form.on('submit(submit)', function (data) {
          $('#submit').attr("disabled",true);
          $('#submit').addClass('layui-btn-disabled');
          $.post('#',data.field,function(res){
              if(res.code == 200){
                  layer.msg(res.msg);
                  setTimeout(() => {
                      window.parent.location.reload();
                      xadmin.close();
                  }, 1000);
              }else{
                 layer.msg(res.msg);
              }
          })
        return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
    });
    //重置按钮，可以提交失败的时候再次提交
    $('#reset').click(function(){
        $('#submit').removeAttr("disabled");
        $('#submit').removeClass('layui-btn-disabled');
    });

  });
  </script>
</body>
</html>

